import { lcPageTable } from './supabase'
import type { LcPageTableType } from './supabase'

export const getPageList = async () => {
  const { data, error } = await lcPageTable.select('*')
  if (error) {
    throw error
  }
  return data
}

export const savePageData = async (pageData: LcPageTableType) => {
  const { data, error } = await lcPageTable.insert(pageData)
  if (error) {
    throw error
  }
  return data
}
